/**
	@author Maciej Suminski
	@version 1.0

	Projekt VoD-ka.
	Klasa obslugujaca protokol RTSP i dekodujaca MPEG. Zastosowano biblioteke FFmpeg <http://ffmpeg.org>.
*/

#ifndef PLAYER_HPP
#define PLAYER_HPP

#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include "video.hpp"

class Player
{
public:
    Player(wxFrame* wind);

    typedef enum { STOP = 1, PLAY, PAUSE } State;

    void open(string address);
    void play();
    void pause();
    wxBitmap getFrame();
    unsigned int getWidth();
    unsigned int getHeight();
    volatile State getState();
private:
    void thread_function();
    wxFrame *window;
    boost::shared_ptr<Video> video;
    boost::shared_ptr<boost::thread> thread;
    State state;
};

#endif /* PLAYER_HPP */
